package  com.bawei.base.userrole.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import  com.bawei.base.userrole.model.ReUserRole;
import  com.bawei.base.userrole.service.ReUserRoleService;
import com.bawei.base.util.JsonUtil;

@RequestMapping("/reUserRole")
@RestController
public class ReUserRoleController {

	@Resource
	private ReUserRoleService reUserRoleService;

	@RequestMapping("/getReUserRole")
	public String getReUserRole() {
		return JsonUtil.success(reUserRoleService.getReUserRole());
	}

	@RequestMapping("/addReUserRole")
	public String addReUserRole(ReUserRole reUserRole) {
		reUserRoleService.addReUserRole(reUserRole);
		return JsonUtil.success();
	}

	@RequestMapping("/updateReUserRole")
	public String updateReUserRole(ReUserRole reUserRole) {
		reUserRoleService.updateReUserRole(reUserRole);
		return JsonUtil.success();
	}

	@RequestMapping("/getReUserRoleById")
	public String getReUserRoleById(String id) {
		return JsonUtil.success(reUserRoleService.getReUserRoleById(Long.valueOf(id)));
	}

	@RequestMapping("/deleteReUserRole")
	public String deleteReUserRole(String id) {
		reUserRoleService.deleteReUserRole(Long.valueOf(id));
		return JsonUtil.success();
	}
}
